var app = angular.module("app",[]);
app.config(function($httpProvider){
    $httpProvider.defaults.transformRequest=function(obj){
        var str=[];
        for(var p in obj){
            str.push(encodeURIComponent(p)+"="+encodeURIComponent(obj[p]));
        }
        return str.join("&");
    };
    $httpProvider.defaults.headers.post={
        'Content-Type':'application/x-www-form-urlencoded'
    }
})

app.controller("WithdrawalsController",function($scope,$http){

	$scope.initView= function(uid){
		$http({
			method:'post',
			url:webRoot+'?s=/App/Username/getUserInfo',
			data:{
				uid:uid,
			}
		}).then(function successCallback(response){
			//console.log(JSON.stringify(response));         
			$scope.info = response.data.data//最新内容数据 
			
		},function errorfunction(e){
			console.log(JSON.stringify(e));
		})	
 	}
});

document.addEventListener('plusready',function(){
	appElement=document.querySelector('[ng-controller=WithdrawalsController]');
	$scope= angular.element(appElement).scope();
	var uid = plus.storage.getItem('id');
    $scope.initView(uid);
	$scope.$apply();
	
});

